home *** CD-ROM | disk | FTP | other *** search
- property state, strokeList, strokeTimer, sp, cst, pos, maxsp
-
- on new me
- me.state = #count
- strokeList = []
- makeList(me, strokeList, "stroke")
- me.sp = 5
- maxsp = me.sp + 25
- me.cst = the member of sprite me.sp
- me.pos = point(50, 148)
- DrawtoStage(me)
- return me
- end
-
- on CheckState me
- case me.state of
- #default:
- #count:
- count(me, strokeList)
- end case
- end
-
- on SetUpPos me, aMem
- me.sp = me.sp + 1
- if me.sp >= maxsp then
- me.state = #default
- end if
- UpdatePos(me, point(25, 0))
- me.cst = aMem
- set the member of sprite the sp of me to me.cst
- DrawtoStage(me)
- end
-
- on count me, aList
- if the timer > strokeTimer then
- tempPos = getOne(aList, me.cst)
- if tempPos = count(aList) then
- tempPos = 1
- else
- tempPos = tempPos + 1
- end if
- SwapCast(me, getAt(aList, tempPos), tempPos)
- Cuestroketimer(me, 30)
- end if
- end
-
- on Cuestroketimer me, aNum
- me.strokeTimer = the timer + aNum
- end
-
- on makeList me, aList, aName
- repeat with x = 1 to the maxinteger
- if the number of member (aName & x) > 0 then
- add(aList, member(aName & x))
- next repeat
- end if
- exit repeat
- end repeat
- end
-
- on SwapCast me, aMem, aNum
- case aNum of
- 1:
- SetUpPos(me, aMem)
- otherwise:
- me.cst = aMem
- set the member of sprite the sp of me to me.cst
- end case
- end
-
- on UpdatePos me, aPos
- tempPos = me.pos + aPos
- me.pos = tempPos
- end
-
- on DrawtoStage me
- set the loc of sprite the sp of me to me.pos
- end
-